package com.relatev.minecraft.TRMExample;

import com.relatev.minecraft.TRMobAPI.TRBossBar;
import com.relatev.minecraft.TRMobAPI.TRJsonConfigurable;
import com.relatev.minecraft.TRMobAPI.TRMob;
import org.bukkit.Bukkit;
import org.bukkit.boss.BossBar;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;

public class GiantBoss extends TRMob implements TRBossBar,TRJsonConfigurable {
    
    public GiantBoss() {
        super("§a巨人Boss", EntityType.GIANT);
        super.loginBukkitTask(Bukkit.getScheduler().runTaskTimer(TRMExample.MainPlugin, new Runnable() {
            @Override
            public void run() {
                for (Entity lent : GiantBoss.super.getLivingMobs()) {
                    TRMExample.MainPlugin.TRTestZombie.spawn(lent.getLocation(), 5);
                }
            }
        }, 5 * 20, 5 * 20));
    }
    
    @Override
    public BossBar getBossBar(Entity ent) {
        return TRBossBar.getDefaultBossBar(this, (LivingEntity) ent);
    }

    @Override
    public int getVisableDistance() {
        return 32;
    }
}
